<template>
  <div class="xtx-numbox">
    <div class="label" >数量</div>
    <div class="numbox">
      <a href="javascript:;" @click="changCount(-1)" >-</a>
      <input type="text" readonly :value="modelValue" />
      <a href="javascript:;" @click="changCount(1)"  >+</a>
    </div>
  </div>
</template>

<script>
export default {
  name: 'myCount',
  props: {
    modelValue: {
      type: Number,
      default: 1
    }
  },
  setup (props, { emit }) {
    const changCount = (number) => {
      const tep = props.modelValue + number
      console.log(tep)
      emit('updata:modelValue', tep)
    }
    return { changCount }
  }
}
</script>

<style>

</style>
